package com.nescafe.nescafepromo.controller;

import com.nescafe.nescafepromo.command.Command;
import com.nescafe.nescafepromo.command.CommandType;
import com.nescafe.nescafepromo.command.user.GetMainPageInfo;
import com.nescafe.nescafepromo.command.user.ShoutOut;
import com.nescafe.nescafepromo.command.user.ViewHistory;
import com.nescafe.nescafepromo.model.NPRequest;

public class UserController extends Controller {

	@Override
	protected void escapeCharacters(NPRequest req) throws ControllerException {
		// TODO Auto-generated method stub

	}

	@Override
	protected void validate(NPRequest req) throws ControllerException {
		// TODO Auto-generated method stub

	}

	@Override
	protected Command getCommand(CommandType commandType) throws ControllerException {
		Command com = null;
		switch (commandType) {
			case GET_MAIN_PAGE_INFO:
				com = new GetMainPageInfo();
				break;
			case SHOUT_OUT:
				com = new ShoutOut();
				break;
			case VIEW_HISTORY:
				com = new ViewHistory();
				break;
			default :
				throw new ControllerException("invalid command");
		}
		return com;
	}

}
